|
stepper25 2.2.1
|
API for configuring and manipulating Stepper 25 Click driver. More...
Topics | |
| Stepper 25 Registers List | |
| List of registers of Stepper 25 Click driver. | |
| Stepper 25 Registers Settings | |
| Settings for registers of Stepper 25 Click driver. | |
| Stepper 25 MikroBUS Map | |
| MikroBUS pin mapping of Stepper 25 Click driver. | |
Functions | |
| void | stepper25_cfg_setup (stepper25_cfg_t *cfg) |
| Stepper 25 configuration object setup function. | |
| err_t | stepper25_init (stepper25_t *ctx, stepper25_cfg_t *cfg) |
| Stepper 25 initialization function. | |
| err_t | stepper25_default_cfg (stepper25_t *ctx) |
| Stepper 25 default configuration function. | |
| err_t | stepper25_write_reg (stepper25_t *ctx, uint8_t reg, uint8_t data_in) |
| Stepper 25 write register function. | |
| err_t | stepper25_read_reg (stepper25_t *ctx, uint8_t reg, uint8_t *data_out) |
| Stepper 25 read register function. | |
| void | stepper25_enable_device (stepper25_t *ctx) |
| Stepper 25 enable device function. | |
| void | stepper25_disable_device (stepper25_t *ctx) |
| Stepper 25 disable device function. | |
| void | stepper25_set_direction (stepper25_t *ctx, uint8_t dir) |
| Stepper 25 set direction function. | |
| void | stepper25_switch_direction (stepper25_t *ctx) |
| Stepper 25 switch direction function. | |
| uint8_t | stepper25_get_fault_pin (stepper25_t *ctx) |
| Stepper 25 get FAULT pin function. | |
| void | stepper25_set_step_pin (stepper25_t *ctx, uint8_t state) |
| Stepper 25 set STEP pin function. | |
| err_t | stepper25_clear_fault (stepper25_t *ctx) |
| Stepper 25 clear fault function. | |
| err_t | stepper25_enable_output (stepper25_t *ctx) |
| Stepper 25 enable output function. | |
| err_t | stepper25_disable_output (stepper25_t *ctx) |
| Stepper 25 disable output function. | |
| err_t | stepper25_set_step_mode (stepper25_t *ctx, uint8_t step_mode) |
| Stepper 25 set step mode function. | |
| err_t | stepper25_drive_motor (stepper25_t *ctx, uint32_t steps, uint8_t speed) |
| Stepper 25 driver motor function. | |
API for configuring and manipulating Stepper 25 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void stepper25_cfg_setup | ( | stepper25_cfg_t * | cfg | ) |
Stepper 25 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See stepper25_cfg_t object definition for detailed explanation. |
| err_t stepper25_clear_fault | ( | stepper25_t * | ctx | ) |
Stepper 25 clear fault function.
This function clears the fault register by setting the CLR_FLT bit.
| [in] | ctx | : Click context object. See stepper25_t object definition for detailed explanation. |
0 - Success, -1 - Error. | err_t stepper25_default_cfg | ( | stepper25_t * | ctx | ) |
Stepper 25 default configuration function.
This function executes a default configuration of Stepper 25 Click board.
| [in] | ctx | : Click context object. See stepper25_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void stepper25_disable_device | ( | stepper25_t * | ctx | ) |
Stepper 25 disable device function.
This function disables the device by setting the SLEEP pin to low logic state.
| [in] | ctx | : Click context object. See stepper25_t object definition for detailed explanation. |
| err_t stepper25_disable_output | ( | stepper25_t * | ctx | ) |
Stepper 25 disable output function.
This function disables all outputs by clearing the EN_OUT bit.
| [in] | ctx | : Click context object. See stepper25_t object definition for detailed explanation. |
0 - Success, -1 - Error. | err_t stepper25_drive_motor | ( | stepper25_t * | ctx, |
| uint32_t | steps, | ||
| uint8_t | speed ) |
Stepper 25 driver motor function.
This function drives the motor for the specific number of steps at the selected speed.
| [in] | ctx | : Click context object. See stepper25_t object definition for detailed explanation. |
| [in] | steps | : Number of steps to rotate motor. |
| [in] | speed | : Motor rotation speed:
|
0 - Success, -1 - Error. | void stepper25_enable_device | ( | stepper25_t * | ctx | ) |
Stepper 25 enable device function.
This function enables the device by setting the SLEEP pin to high logic state.
| [in] | ctx | : Click context object. See stepper25_t object definition for detailed explanation. |
| err_t stepper25_enable_output | ( | stepper25_t * | ctx | ) |
Stepper 25 enable output function.
This function enables all outputs by setting the EN_OUT bit.
| [in] | ctx | : Click context object. See stepper25_t object definition for detailed explanation. |
0 - Success, -1 - Error. | uint8_t stepper25_get_fault_pin | ( | stepper25_t * | ctx | ) |
Stepper 25 get FAULT pin function.
This function returns the FAULT pin logic state.
| [in] | ctx | : Click context object. See stepper25_t object definition for detailed explanation. |
| err_t stepper25_init | ( | stepper25_t * | ctx, |
| stepper25_cfg_t * | cfg ) |
Stepper 25 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See stepper25_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See stepper25_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t stepper25_read_reg | ( | stepper25_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_out ) |
Stepper 25 read register function.
This function reads a byte of data from the specified register using the SPI interface.
| [in] | ctx | : Click context object. See stepper25_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [out] | data_out | : Pointer to store the read data. |
0 - Success, -1 - Error. | void stepper25_set_direction | ( | stepper25_t * | ctx, |
| uint8_t | dir ) |
Stepper 25 set direction function.
This function sets the motor direction by setting the DIR pin logic state.
| [in] | ctx | : Click context object. See stepper25_t object definition for detailed explanation. |
| [in] | dir | :
|
| err_t stepper25_set_step_mode | ( | stepper25_t * | ctx, |
| uint8_t | step_mode ) |
Stepper 25 set step mode function.
This function sets the step mode (microstepping level) of the Stepper 25 device.
| [in] | ctx | : Click context object. See stepper25_t object definition for detailed explanation. |
| [in] | step_mode | : Step mode value (e.g., full-step, half-step, 1/4-step, etc.), refer to STEPPER25_STEP_MODE_x macros definition. |
0 - Success, -1 - Error. | void stepper25_set_step_pin | ( | stepper25_t * | ctx, |
| uint8_t | state ) |
Stepper 25 set STEP pin function.
This function sets the STEP pin logic state.
| [in] | ctx | : Click context object. See stepper25_t object definition for detailed explanation. |
| [in] | state | :
|
| void stepper25_switch_direction | ( | stepper25_t * | ctx | ) |
Stepper 25 switch direction function.
This function switches the motor direction by toggling the DIR pin.
| [in] | ctx | : Click context object. See stepper25_t object definition for detailed explanation. |
| err_t stepper25_write_reg | ( | stepper25_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t | data_in ) |
Stepper 25 write register function.
This function writes a byte of data to the specified register using the SPI interface.
| [in] | ctx | : Click context object. See stepper25_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [in] | data_in | : Data to be written to the register. |
0 - Success, -1 - Error.